package numerals;

public class ArabicToRomanUpper implements ArabicToRoman {

	@Override
	public String convert(int arabicNumber) throws NoRomanEquivalentException {
		String romanNumber = "";

		switch (arabicNumber) {
		case 1:
		case 2:
		case 3:
			romanNumber = addingEyes(arabicNumber, romanNumber);
			break;
		case 4:
			romanNumber = "IV";
			break;
		case 5:
		case 6:
		case 7:
		case 8:
			romanNumber = "V";
			arabicNumber = arabicNumber - 5;
			romanNumber = addingEyes(arabicNumber, romanNumber);
			break;
		default:
			//throw new NoRomanEquivalentException("Can't convert this number to Roman characters.");
		}

		return romanNumber;
	}

	private String addingEyes(int arabicNumber, String romanNumber) {
		for (int i = 1; i <= arabicNumber; i++) {
			romanNumber = romanNumber + "I";
		}
		return romanNumber;
	}

}
